package com.md.facade;

import com.md.api.InternalApi;
import com.md.application.service.InternalApplication;
import com.md.config.Logs;
import com.md.model.system.CommonResult;
import com.md.request.GlobalConfigRequest;
import com.md.value.enums.OperationEnum;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 刘骄阳
 * 2024-07-14 22:16
 */
@RestController
@RequiredArgsConstructor
public class InternalController implements InternalApi {
  private final InternalApplication internalApplication;

  @Override
  @Logs(title = "初始化项目", operation = OperationEnum.INSERT)
  public CommonResult<Void> init() {
    return internalApplication.init();
  }

  @Override
  @Logs(title = "追加权限", operation = OperationEnum.INSERT)
  public CommonResult<Void> appendRolePermission() {
    return internalApplication.appendRolePermission();
  }

  @Override
  @Logs(title = "追加配置", operation = OperationEnum.INSERT)
  public CommonResult<Void> appendConfig(final GlobalConfigRequest request) {
    return internalApplication.appendConfig(request);
  }
}
